package com.eboss.sbs.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

import com.eboss.sbs.R;
import com.eboss.sbs.activity.base.TabBasicActivity;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.wosai.upay.util.ToastUtil;

public class MineActivity extends TabBasicActivity {

	private ImageView img_user_icon;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		mActivity = this;
		setContentView(R.layout.activity_mine);
		super.onCreate(savedInstanceState);
		initView();
	}
	
	private void initView(){
		showView(R.id.titleback_btn_back, false);
		setTvText(R.id.tv_title, "我的商博士");
		showView(R.id.next_sure, true);
		setTvText(R.id.next_sure, "设置");
		
		img_user_icon = (ImageView) findViewById(R.id.img_user_icon);
		ImageLoader.getInstance().displayImage(mApp.getLoginEntity().getMerchantIconUrl(), img_user_icon);
		setTvText(R.id.tv_username, mApp.getLoginEntity().getName());

		findViewById(R.id.layout_myinfo).setOnClickListener(this);
		findViewById(R.id.layout_terminals).setOnClickListener(this);
		findViewById(R.id.layout_barcodes).setOnClickListener(this);
		findViewById(R.id.layout_mydatas).setOnClickListener(this);
		findViewById(R.id.layout_wallet).setOnClickListener(this);
		findViewById(R.id.layout_feedback).setOnClickListener(this);
		findViewById(R.id.next_sure).setOnClickListener(this);
		
	}
	
	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.layout_myinfo:
			startActivity(new Intent(mActivity, MyInfoActivity.class));
			break;
		case R.id.layout_terminals:
			startActivity(new Intent(mActivity, TerminalsActivity.class));
			break;
		case R.id.layout_barcodes:
			startActivity(new Intent(mActivity, BarcodesActivity.class));
			break;
		case R.id.layout_mydatas:
			startActivity(new Intent(mActivity, MyDatasActivity.class));
			break;
		case R.id.layout_wallet:
			ToastUtil.toast(this, "该功能暂未开通");
//			startActivity(new Intent(mActivity, MyWalletActivity.class));
			break;
		case R.id.layout_feedback:
			startActivity(new Intent(mActivity, FeedBackActivity.class));
			break;
		case R.id.next_sure:
			startActivity(new Intent(mActivity, SettingActivity.class));
			break;
		default: break;
		}
		super.onClick(v);
	}
	
}
